﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:basics="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls" xmlns:inputCtl="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input" xmlns:localControls="clr-namespace:HSS.Xaml.UI.Controls" xmlns:System="clr-namespace:System;assembly=mscorlib">

	<!--ValidationToolTipTemplate Style-->
	<ControlTemplate x:Key="ValidationToolTipTemplate">
		<Grid x:Name="Root" Margin="5,0" Opacity="0" RenderTransformOrigin="0,0">
			<Grid.RenderTransform>
				<TranslateTransform x:Name="xform" X="-25"/>
			</Grid.RenderTransform>
			<VisualStateManager.VisualStateGroups>
				<VisualStateGroup x:Name="OpenStates">
					<VisualStateGroup.Transitions>
						<VisualTransition GeneratedDuration="0"/>
						<VisualTransition GeneratedDuration="0:0:0.2" To="Open">
							<Storyboard>
								<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="X" Storyboard.TargetName="xform">
									<SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
								</DoubleAnimationUsingKeyFrames>
								<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Root">
									<SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="1"/>
								</DoubleAnimationUsingKeyFrames>
							</Storyboard>
						</VisualTransition>
					</VisualStateGroup.Transitions>
					<VisualState x:Name="Closed">
						<Storyboard>
							<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Root">
								<SplineDoubleKeyFrame KeyTime="0" Value="0"/>
							</DoubleAnimationUsingKeyFrames>
						</Storyboard>
					</VisualState>
					<VisualState x:Name="Open">
						<Storyboard>
							<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="X" Storyboard.TargetName="xform">
								<SplineDoubleKeyFrame KeyTime="0" Value="0"/>
							</DoubleAnimationUsingKeyFrames>
							<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Root">
								<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
							</DoubleAnimationUsingKeyFrames>
						</Storyboard>
					</VisualState>
				</VisualStateGroup>
			</VisualStateManager.VisualStateGroups>
			<Border Background="{StaticResource ValidationBrush1}" CornerRadius="5" Margin="4,4,-4,-4"/>
			<Border Background="{StaticResource ValidationBrush2}" CornerRadius="4" Margin="3,3,-3,-3"/>
			<Border Background="{StaticResource ValidationBrush3}" CornerRadius="3" Margin="2,2,-2,-2"/>
			<Border Background="{StaticResource ValidationBrush4}" CornerRadius="2" Margin="1,1,-1,-1"/>
			<Border Background="{StaticResource ValidationBrush5}" CornerRadius="2"/>
			<Border CornerRadius="2">
				<TextBlock Foreground="{StaticResource WhiteColorBrush}" MaxWidth="250" Margin="8,4,8,4" TextWrapping="Wrap" Text="{Binding (Validation.Errors)[0].ErrorContent}" UseLayoutRounding="false"/>
			</Border>
		</Grid>
	</ControlTemplate>
	
	<!-- Custom ComboToggleButton for the AutoCompleteComboBoxStyle -->
	<Style x:Key="ComboToggleButton" TargetType="ToggleButton">
		<Setter Property="Foreground" Value="#FF333333"/>
		<Setter Property="IsTabStop" Value="False" />
		<Setter Property="Background" Value="#FF1F3B53"/>
		<Setter Property="Padding" Value="0"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="ToggleButton">
					<Grid>
						<Rectangle Fill="Transparent" />
						<ContentPresenter x:Name="contentPresenter"
										  Content="{TemplateBinding Content}"
										  ContentTemplate="{TemplateBinding ContentTemplate}"
										  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
										  VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
										  Margin="{TemplateBinding Padding}"/>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
	<!-- TextOverflowTooltip -->
	<ControlTemplate x:Key="TextOverflowTooltip" TargetType="ToolTip">
		<Grid x:Name="Root" Margin="5,0" RenderTransformOrigin="0,0" Opacity="0">
			<Grid.RenderTransform>
				<TranslateTransform x:Name="Translation" X="-25"/>
			</Grid.RenderTransform>
			<VisualStateManager.VisualStateGroups>
				<VisualStateGroup Name="OpenStates">
					<VisualStateGroup.Transitions>
						<VisualTransition GeneratedDuration="0" />
						<VisualTransition To="Open" GeneratedDuration="0:0:0.2">
							<Storyboard>
								<DoubleAnimation Storyboard.TargetName="Translation" Storyboard.TargetProperty="X" To="0" Duration="0:0:0.2">
									<DoubleAnimation.EasingFunction>
										<BackEase Amplitude=".3" EasingMode="EaseOut" />
									</DoubleAnimation.EasingFunction>
								</DoubleAnimation>
								<DoubleAnimation Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.2" />
							</Storyboard>
						</VisualTransition>
					</VisualStateGroup.Transitions>
					<VisualState x:Name="Closed">
						<Storyboard>
							<DoubleAnimation Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity" To="0" Duration="0" />
						</Storyboard>
					</VisualState>
					<VisualState x:Name="Open">
						<Storyboard>
							<DoubleAnimation Storyboard.TargetName="Translation" Storyboard.TargetProperty="X" To="0" Duration="0" />
							<DoubleAnimation Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
						</Storyboard>
					</VisualState>
				</VisualStateGroup>
			</VisualStateManager.VisualStateGroups>

			<Border BorderBrush="DimGray" BorderThickness="1" CornerRadius="3">
				<Border.Effect>
					<DropShadowEffect Opacity="0.5" Color="Black" Direction="335" BlurRadius="5" ShadowDepth="4"/>
				</Border.Effect>
				<Border.Background>
					<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
						<GradientStop Color="WhiteSmoke" Offset="1"/>
						<GradientStop Color="White"/>
					</LinearGradientBrush>
				</Border.Background>
				<TextBlock UseLayoutRounding="false" Margin="2" MaxWidth="500" TextWrapping="Wrap" Text="{Binding Text}" Foreground="DimGray" />
			</Border>
		</Grid>
	</ControlTemplate>
	
	<!-- TextBoxWithToolTip -->
	<Style TargetType="localControls:TextBoxWithToolTip">
		<Setter Property="BorderThickness" Value="1"/>
		<Setter Property="Background" Value="#FFFFFFFF"/>
		<Setter Property="Foreground" Value="#FF000000"/>
		<Setter Property="Padding" Value="2"/>
		<Setter Property="BorderBrush">
			<Setter.Value>
				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
					<GradientStop Color="#FFA3AEB9" Offset="0"/>
					<GradientStop Color="#FF8399A9" Offset="0.375"/>
					<GradientStop Color="#FF718597" Offset="0.375"/>
					<GradientStop Color="#FF617584" Offset="1"/>
				</LinearGradientBrush>
			</Setter.Value>
		</Setter>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="localControls:TextBoxWithToolTip">
					<Grid x:Name="RootElement">
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualState x:Name="Normal"/>
								<VisualState x:Name="MouseOver">
									<Storyboard>
										<ColorAnimationUsingKeyFrames Storyboard.TargetName="MouseOverBorder" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)">
											<SplineColorKeyFrame KeyTime="0" Value="#FF99C1E2"/>
										</ColorAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="Disabled">
									<Storyboard>
										<DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
											<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
										</DoubleAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="ReadOnly">
									<Storyboard>
										<DoubleAnimationUsingKeyFrames Storyboard.TargetName="ReadOnlyVisualElement" Storyboard.TargetProperty="Opacity">
											<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
										</DoubleAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
							<VisualStateGroup x:Name="FocusStates">
								<VisualState x:Name="Focused">
									<Storyboard>
										<DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
											<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
										</DoubleAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="Unfocused">
									<Storyboard>
										<DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
											<SplineDoubleKeyFrame KeyTime="0" Value="0"/>
										</DoubleAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
							<VisualStateGroup x:Name="ValidationStates">
								<VisualState x:Name="Valid"/>
								<VisualState x:Name="InvalidUnfocused">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
											<DiscreteObjectKeyFrame KeyTime="0">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Visible</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="InvalidFocused">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
											<DiscreteObjectKeyFrame KeyTime="0">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Visible</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsOpen">
											<DiscreteObjectKeyFrame KeyTime="0">
												<DiscreteObjectKeyFrame.Value>
													<System:Boolean>True</System:Boolean>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
							<VisualStateGroup x:Name="TextTooLongStates">
								<VisualState x:Name="NotTooLong">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetName="textTooLongTooltip" Storyboard.TargetProperty="Visibility">
											<DiscreteObjectKeyFrame KeyTime="0">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Collapsed</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="TooLong">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetName="textTooLongTooltip" Storyboard.TargetProperty="Visibility">
											<DiscreteObjectKeyFrame KeyTime="0">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Visible</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
						<Border x:Name="Border" Opacity="1" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="1">
							<Grid>
								<Border x:Name="ReadOnlyVisualElement" Opacity="0" Background="#5EC9C9C9"/>
								<Border x:Name="MouseOverBorder" BorderBrush="Transparent" BorderThickness="1">
									<ScrollViewer x:Name="ContentElement" BorderThickness="0" IsTabStop="False" Padding="{TemplateBinding Padding}">
										<ToolTipService.ToolTip>
											<ToolTip x:Name="textTooLongTooltip" Template="{StaticResource TextOverflowTooltip}" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
												<ToolTip.Triggers>
													<EventTrigger RoutedEvent="Canvas.Loaded">
														<BeginStoryboard>
															<Storyboard>
																<ObjectAnimationUsingKeyFrames Storyboard.TargetName="textTooLongTooltip" Storyboard.TargetProperty="IsHitTestVisible">
																	<DiscreteObjectKeyFrame KeyTime="0">
																		<DiscreteObjectKeyFrame.Value>
																			<System:Boolean>true</System:Boolean>
																		</DiscreteObjectKeyFrame.Value>
																	</DiscreteObjectKeyFrame>
																</ObjectAnimationUsingKeyFrames>
															</Storyboard>
														</BeginStoryboard>
													</EventTrigger>
												</ToolTip.Triggers>
											</ToolTip>
										</ToolTipService.ToolTip>
									</ScrollViewer>
								</Border>
							</Grid>
						</Border>
						<Border x:Name="DisabledVisualElement" IsHitTestVisible="False" Opacity="0" Background="#A5F7F7F7" BorderBrush="#A5F7F7F7" BorderThickness="{TemplateBinding BorderThickness}"/>
						<Border x:Name="FocusVisualElement" Margin="1" IsHitTestVisible="False" Opacity="0" BorderBrush="#FF6DBDD1" BorderThickness="{TemplateBinding BorderThickness}"/>
						<Border x:Name="ValidationErrorElement" Visibility="Collapsed" BorderBrush="#FFDB000C" BorderThickness="1" CornerRadius="1">
							<ToolTipService.ToolTip>
								<ToolTip x:Name="validationTooltip" Template="{StaticResource ValidationToolTipTemplate}" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
									<ToolTip.Triggers>
										<EventTrigger RoutedEvent="Canvas.Loaded">
											<BeginStoryboard>
												<Storyboard>
													<ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsHitTestVisible">
														<DiscreteObjectKeyFrame KeyTime="0">
															<DiscreteObjectKeyFrame.Value>
																<System:Boolean>true</System:Boolean>
															</DiscreteObjectKeyFrame.Value>
														</DiscreteObjectKeyFrame>
													</ObjectAnimationUsingKeyFrames>
												</Storyboard>
											</BeginStoryboard>
										</EventTrigger>
									</ToolTip.Triggers>
								</ToolTip>
							</ToolTipService.ToolTip>
							<Grid Height="12" HorizontalAlignment="Right" Margin="1,-4,-4,0" VerticalAlignment="Top" Width="12" Background="Transparent">
								<Path Fill="#FFDC000C" Margin="1,3,0,0" Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z"/>
								<Path Fill="#ffffff" Margin="1,3,0,0" Data="M 0,0 L2,0 L 8,6 L8,8"/>
							</Grid>
						</Border>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
	<!-- LabelTextBox -->
	<Style TargetType="localControls:LabelTextBox">
		<Setter Property="BorderThickness" Value="0"/>
		<Setter Property="Background" Value="#FFFFFFFF"/>
		<Setter Property="Foreground" Value="#FF000000"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="localControls:LabelTextBox">
					<Grid x:Name="RootElement">
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualState x:Name="Normal"/>
								<VisualState x:Name="MouseOver">
									<Storyboard>
										<ColorAnimationUsingKeyFrames Storyboard.TargetName="MouseOverBorder" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)">
											<SplineColorKeyFrame KeyTime="0" Value="#FF99C1E2"/>
										</ColorAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="Disabled">
									<Storyboard>
										<DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
											<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
										</DoubleAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="ReadOnly"/>
							</VisualStateGroup>
							<VisualStateGroup x:Name="FocusStates">
								<VisualState x:Name="Focused">
									<Storyboard>
										<DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
											<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
										</DoubleAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="Unfocused">
									<Storyboard>
										<DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
											<SplineDoubleKeyFrame KeyTime="0" Value="0"/>
										</DoubleAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
							<VisualStateGroup x:Name="ValidationStates">
								<VisualState x:Name="Valid"/>
								<VisualState x:Name="InvalidUnfocused">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
											<DiscreteObjectKeyFrame KeyTime="0">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Visible</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="InvalidFocused">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
											<DiscreteObjectKeyFrame KeyTime="0">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Visible</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsOpen">
											<DiscreteObjectKeyFrame KeyTime="0">
												<DiscreteObjectKeyFrame.Value>
													<System:Boolean>True</System:Boolean>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
							<VisualStateGroup x:Name="TextTooLongStates">
								<VisualState x:Name="NotTooLong">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetName="textTooLongTooltip" Storyboard.TargetProperty="Visibility">
											<DiscreteObjectKeyFrame KeyTime="0">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Collapsed</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="TooLong">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetName="textTooLongTooltip" Storyboard.TargetProperty="Visibility">
											<DiscreteObjectKeyFrame KeyTime="0">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Visible</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
						<Border x:Name="Border" Opacity="1" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="1">
							<Grid>
								<Border x:Name="MouseOverBorder" BorderBrush="Transparent" BorderThickness="1">
									<ScrollViewer x:Name="ContentElement" BorderThickness="0" IsTabStop="False" Padding="{TemplateBinding Padding}">
										<ToolTipService.ToolTip>
											<ToolTip x:Name="textTooLongTooltip" Template="{StaticResource TextOverflowTooltip}" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
												<ToolTip.Triggers>
													<EventTrigger RoutedEvent="Canvas.Loaded">
														<BeginStoryboard>
															<Storyboard>
																<ObjectAnimationUsingKeyFrames Storyboard.TargetName="textTooLongTooltip" Storyboard.TargetProperty="IsHitTestVisible">
																	<DiscreteObjectKeyFrame KeyTime="0">
																		<DiscreteObjectKeyFrame.Value>
																			<System:Boolean>true</System:Boolean>
																		</DiscreteObjectKeyFrame.Value>
																	</DiscreteObjectKeyFrame>
																</ObjectAnimationUsingKeyFrames>
															</Storyboard>
														</BeginStoryboard>
													</EventTrigger>
												</ToolTip.Triggers>
											</ToolTip>
										</ToolTipService.ToolTip>
									</ScrollViewer>
								</Border>
							</Grid>
						</Border>
						<Border x:Name="DisabledVisualElement" IsHitTestVisible="False" Opacity="0" Background="#A5F7F7F7" BorderBrush="#A5F7F7F7" BorderThickness="{TemplateBinding BorderThickness}"/>
						<Border x:Name="FocusVisualElement" Margin="1" IsHitTestVisible="False" Opacity="0" BorderBrush="#FF6DBDD1" BorderThickness="{TemplateBinding BorderThickness}"/>
						<Border x:Name="ValidationErrorElement" Visibility="Collapsed" BorderBrush="#FFDB000C" BorderThickness="1" CornerRadius="1">
							<ToolTipService.ToolTip>
								<ToolTip x:Name="validationTooltip" Template="{StaticResource ValidationToolTipTemplate}" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
									<ToolTip.Triggers>
										<EventTrigger RoutedEvent="Canvas.Loaded">
											<BeginStoryboard>
												<Storyboard>
													<ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsHitTestVisible">
														<DiscreteObjectKeyFrame KeyTime="0">
															<DiscreteObjectKeyFrame.Value>
																<System:Boolean>true</System:Boolean>
															</DiscreteObjectKeyFrame.Value>
														</DiscreteObjectKeyFrame>
													</ObjectAnimationUsingKeyFrames>
												</Storyboard>
											</BeginStoryboard>
										</EventTrigger>
									</ToolTip.Triggers>
								</ToolTip>
							</ToolTipService.ToolTip>
							<Grid Height="12" HorizontalAlignment="Right" Margin="1,-4,-4,0" VerticalAlignment="Top" Width="12" Background="Transparent">
								<Path Fill="#FFDC000C" Margin="1,3,0,0" Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z"/>
								<Path Fill="#ffffff" Margin="1,3,0,0" Data="M 0,0 L2,0 L 8,6 L8,8"/>
							</Grid>
						</Border>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
	<!-- PropertyGrid -->
	<Style TargetType="localControls:PropertyGrid">
		<Setter Property="HorizontalAlignment" Value="Stretch" />
		<Setter Property="HorizontalContentAlignment" Value="Stretch" />
		<Setter Property="VerticalAlignment" Value="Stretch" />
		<Setter Property="VerticalContentAlignment" Value="Stretch" />
		<Setter Property="ToolbarBorderThickness" Value="1,1,1,0" />
		<Setter Property="DescriptionBorderThickness" Value="1" />
		<Setter Property="BorderBrush" Value="Gray" />
		<Setter Property="BorderThickness" Value="1" />
		<Setter Property="Background" Value="#FFE1EBF5" />
		<Setter Property="DefaultLabelWidth" Value="200" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="localControls:PropertyGrid">
					<Grid Background="White">
						<Grid.ColumnDefinitions>
							<ColumnDefinition />
						</Grid.ColumnDefinitions>
						<Grid.RowDefinitions>
							<RowDefinition Height="Auto" />
							<RowDefinition />
							<RowDefinition x:Name="MainSplitterRow" Height="3" />
							<RowDefinition x:Name="MainDescriptionRow" Height="0.1*" MaxHeight="120" MinHeight="60" />
						</Grid.RowDefinitions>
						<Grid.Resources>
							<!-- PropertyGridButton -->
							<Style x:Key="PropertyGridButton" TargetType="ToggleButton">
								<Setter Property="Background" Value="#FF1F3B53" />
								<Setter Property="Foreground" Value="#FF000000" />
								<Setter Property="Padding" Value="3" />
								<Setter Property="BorderThickness" Value="1" />
								<Setter Property="BorderBrush">
									<Setter.Value>
										<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
											<GradientStop Color="#FF53AEB9" Offset="0" />
											<GradientStop Color="#FF8399A9" Offset="0.375" />
											<GradientStop Color="#FF718597" Offset="0.375" />
											<GradientStop Color="#FF617584" Offset="1" />
										</LinearGradientBrush>
									</Setter.Value>
								</Setter>
								<Setter Property="Template">
									<Setter.Value>
										<ControlTemplate TargetType="ToggleButton">
											<Grid>
												<VisualStateManager.VisualStateGroups>
													<VisualStateGroup x:Name="CommonStates">
														<VisualState x:Name="Normal" />
														<VisualState x:Name="MouseOver">
															<Storyboard>
																<DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundAnimation" Storyboard.TargetProperty="Opacity">
																	<SplineDoubleKeyFrame KeyTime="0" Value="1" />
																</DoubleAnimationUsingKeyFrames>
																<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
																	<SplineColorKeyFrame KeyTime="0" Value="#F2FFFFFF" />
																</ColorAnimationUsingKeyFrames>
																<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
																	<SplineColorKeyFrame KeyTime="0" Value="#CCFFFFFF" />
																</ColorAnimationUsingKeyFrames>
																<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
																	<SplineColorKeyFrame KeyTime="0" Value="#7FFFFFFF" />
																</ColorAnimationUsingKeyFrames>
																<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(UIElement.Opacity)" BeginTime="00:00:00" Duration="00:00:00.0010000">
																	<EasingDoubleKeyFrame KeyTime="00:00:00" Value="1" />
																</DoubleAnimationUsingKeyFrames>
															</Storyboard>
														</VisualState>
														<VisualState x:Name="Pressed">
															<Storyboard>
																<ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)">
																	<SplineColorKeyFrame KeyTime="0" Value="#FF6DBDD1" />
																</ColorAnimationUsingKeyFrames>
																<DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundAnimation" Storyboard.TargetProperty="Opacity">
																	<SplineDoubleKeyFrame KeyTime="0" Value="1" />
																</DoubleAnimationUsingKeyFrames>
																<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
																	<SplineColorKeyFrame KeyTime="0" Value="#D8FFFFFF" />
																</ColorAnimationUsingKeyFrames>
																<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
																	<SplineColorKeyFrame KeyTime="0" Value="#C6FFFFFF" />
																</ColorAnimationUsingKeyFrames>
																<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
																	<SplineColorKeyFrame KeyTime="0" Value="#8CFFFFFF" />
																</ColorAnimationUsingKeyFrames>
																<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
																	<SplineColorKeyFrame KeyTime="0" Value="#3FFFFFFF" />
																</ColorAnimationUsingKeyFrames>
																<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(UIElement.Opacity)" BeginTime="00:00:00" Duration="00:00:00.0010000">
																	<EasingDoubleKeyFrame KeyTime="00:00:00" Value="1" />
																</DoubleAnimationUsingKeyFrames>
															</Storyboard>
														</VisualState>
														<VisualState x:Name="Disabled">
															<Storyboard>
																<DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
																	<SplineDoubleKeyFrame KeyTime="0" Value=".55" />
																</DoubleAnimationUsingKeyFrames>
															</Storyboard>
														</VisualState>
													</VisualStateGroup>
													<VisualStateGroup x:Name="CheckStates">
														<VisualState x:Name="Checked">
															<Storyboard>
																<PointAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Rectangle.Fill).(LinearGradientBrush.StartPoint)">
																	<SplinePointKeyFrame KeyTime="0" Value="0.7,1" />
																</PointAnimationUsingKeyFrames>
																<PointAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Rectangle.Fill).(LinearGradientBrush.EndPoint)">
																	<SplinePointKeyFrame KeyTime="0" Value="0.7,0" />
																</PointAnimationUsingKeyFrames>
																<DoubleAnimationUsingKeyFrames Storyboard.TargetName="CheckedVisualElement" Storyboard.TargetProperty="Opacity">
																	<SplineDoubleKeyFrame KeyTime="0" Value=".75" />
																</DoubleAnimationUsingKeyFrames>
															</Storyboard>
														</VisualState>
														<VisualState x:Name="Unchecked">
														</VisualState>
													</VisualStateGroup>
													<VisualStateGroup x:Name="FocusStates">
														<VisualState x:Name="Focused" />
														<VisualState x:Name="Unfocused" />
													</VisualStateGroup>
												</VisualStateManager.VisualStateGroups>
												<Border x:Name="Background" Background="White" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="0" Opacity="0">
													<Grid Margin="1" Background="{TemplateBinding Background}">
														<Border x:Name="BackgroundAnimation" Background="#FF448DCA" Opacity="0" />
														<Rectangle x:Name="BackgroundGradient">
															<Rectangle.Fill>
																<LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
																	<GradientStop Color="#F9FFFFFF" />
																	<GradientStop Color="#E5FFFFFF" Offset="0.375" />
																	<GradientStop Color="#B2FFFFFF" Offset="0.625" />
																	<GradientStop Color="#7fFFFFFF" Offset="1" />
																</LinearGradientBrush>
															</Rectangle.Fill>
														</Rectangle>
													</Grid>
												</Border>
												<Border x:Name="CheckedVisualElement" Background="#FF6DBDD1" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" IsHitTestVisible="false" Opacity="0">
													<Grid Margin="0" Background="{TemplateBinding Background}">
														<Border Background="#FF448DCA" Opacity=".75" />
														<Rectangle>
															<Rectangle.Fill>
																<LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
																	<GradientStop Color="#F9FFFFFF" />
																	<GradientStop Color="#E5FFFFFF" Offset="0.375" />
																	<GradientStop Color="#B2FFFFFF" Offset="0.625" />
																	<GradientStop Color="#7fFFFFFF" Offset="1" />
																</LinearGradientBrush>
															</Rectangle.Fill>
														</Rectangle>
													</Grid>
												</Border>
												<ContentPresenter x:Name="contentPresenter" Margin="{TemplateBinding Padding}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
												<Rectangle x:Name="DisabledVisualElement" Fill="#FFFFFFFF" IsHitTestVisible="false" Opacity="0" RadiusX="0" RadiusY="0" />
											</Grid>
										</ControlTemplate>
									</Setter.Value>
								</Setter>
							</Style>
						</Grid.Resources>
						<!--Toolbar-->
						<Border x:Name="Toolbar" Grid.Column="0" Grid.Row="0" Height="27" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding ToolbarBorderThickness}" CornerRadius="0">
							<Border.Background>
								<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
									<GradientStop Color="#FFC5CCDB" Offset="1" />
									<GradientStop Color="#FFD2D7E4" Offset="0.645" />
									<GradientStop Color="#FFE9ECF2" Offset="0.345" />
									<GradientStop Color="#FFFFFFFF" Offset="0" />
								</LinearGradientBrush>
							</Border.Background>
							<Grid Margin="2,2,2,2">
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="0" />
									<ColumnDefinition Width="24" />
									<ColumnDefinition Width="24" />
									<ColumnDefinition Width="8" />
									<ColumnDefinition Width="50*" />
									<ColumnDefinition Width="50" />
								</Grid.ColumnDefinitions>
								<Grid.RowDefinitions>
									<RowDefinition />
								</Grid.RowDefinitions>
								<ToggleButton Style="{StaticResource PropertyGridButton}" x:Name="ToolbarCategorizeButton" Grid.Column="1" HorizontalAlignment="Stretch" IsChecked="True" IsTabStop="False" VerticalAlignment="Stretch">
									<Image Height="16" Source="/SLG50;component/assets/categorize.png" />
								</ToggleButton>
								<ToggleButton Style="{StaticResource PropertyGridButton}" x:Name="ToolbarSortButton" Grid.Column="2" HorizontalAlignment="Stretch" IsTabStop="False" VerticalAlignment="Stretch">
									<Image Height="16" Source="/SLG50;component/assets/sortaz.png" />
								</ToggleButton>
								<Path Grid.Column="3" Data="M 4.0,3.0 L 4.0,19.0" StrokeThickness="2">
									<Path.Stroke>
										<LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
											<GradientStop Color="#FF818181" />
											<GradientStop Color="White" Offset="1" />
											<GradientStop Color="#FFB8BCBE" Offset="0.552" />
											<GradientStop Color="#FFF9F9F9" Offset="0.601" />
										</LinearGradientBrush>
									</Path.Stroke>
								</Path>
								<TextBox x:Name="ToolbarFilterTextBox" Grid.Column="4" Margin="4,0,0,0" Background="#FFFAFAFA" IsTabStop="False">
									<TextBox.BorderBrush>
										<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
											<GradientStop Color="#FF727272" Offset="1" />
											<GradientStop Color="#FFAFAFAF" />
										</LinearGradientBrush>
									</TextBox.BorderBrush>
								</TextBox>
								<Button x:Name="ToolbarClearButton" Grid.Column="5" BorderBrush="{x:Null}" Content="Clear" IsTabStop="False" />
							</Grid>
						</Border>
						<!--Actual Property Grid-->
						<Border x:Name="MainBorder" Grid.Row="1" Margin="0" Padding="0" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
							<Grid x:Name="ViewPort" Background="White">
								<Grid.ColumnDefinitions>
									<!--MainGrid-->
									<ColumnDefinition />
									<!--MainScrollBar-->
									<ColumnDefinition Width="Auto" />
								</Grid.ColumnDefinitions>
								<Grid.RowDefinitions>
									<RowDefinition />
								</Grid.RowDefinitions>
								<!--MainGrid-->
								<Grid x:Name="MainGrid" Grid.Column="0" Grid.Row="0" VerticalAlignment="Top">
									<Grid.ColumnDefinitions>
										<!--Margin-->
										<ColumnDefinition Width="16" />
										<!--Labels-->
										<ColumnDefinition x:Name="gridLabelColumnDefinition" Width="{TemplateBinding DefaultLabelWidth}" MinWidth="25" />
										<!--Editors-->
										<ColumnDefinition MinWidth="25" />
									</Grid.ColumnDefinitions>
								</Grid>
								<!--MainScrollBar-->
								<ScrollBar x:Name="MainScrollBar" Grid.Column="1" Grid.Row="0" Width="0" HorizontalAlignment="Right" IsTabStop="False" VerticalAlignment="Stretch" />
							</Grid>
						</Border>
						<!--Property Grid / Description Separator-->
						<basics:GridSplitter x:Name="MainSplitter" Grid.Column="0" Grid.Row="2" HorizontalAlignment="Stretch" IsTabStop="False" ShowsPreview="False" />
						<!--Property Description-->
						<Border x:Name="MainDescription" Grid.Row="3" Background="WhiteSmoke" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding DescriptionBorderThickness}" CornerRadius="0">
							<Grid>
								<Grid.ColumnDefinitions>
									<ColumnDefinition />
								</Grid.ColumnDefinitions>
								<Grid.RowDefinitions>
									<RowDefinition Height="20" />
									<RowDefinition />
								</Grid.RowDefinitions>
								<TextBlock x:Name="SelectedPropertyName" Grid.Row="0" Margin="5,2,2,2" FontWeight="Bold" />
								<TextBlock x:Name="SelectedPropertyDescription" Grid.Row="1" Margin="5,2,2,2" TextWrapping="Wrap" />
							</Grid>
						</Border>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<!-- PropertyGridLabelControl -->
	<Style TargetType="localControls:PropertyGridLabelControl">
		<Setter Property="HorizontalAlignment" Value="Stretch" />
		<Setter Property="HorizontalContentAlignment" Value="Stretch" />
		<Setter Property="VerticalAlignment" Value="Stretch" />
		<Setter Property="VerticalContentAlignment" Value="Stretch" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="localControls:PropertyGridLabelControl">
					<ContentPresenter>
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="SelectionStates">
								<VisualState x:Name="SelectedActiveReadOnly">
									<Storyboard>
										<ColorAnimationUsingKeyFrames Storyboard.TargetName="LabelBorder" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" BeginTime="00:00:00" Duration="00:00:00.0010000">
											<EasingColorKeyFrame KeyTime="00:00:00" Value="#FF5EAAFF" />
										</ColorAnimationUsingKeyFrames>
										<ColorAnimationUsingKeyFrames Storyboard.TargetName="LabelText" Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" BeginTime="00:00:00" Duration="00:00:00.0010000">
											<EasingColorKeyFrame KeyTime="00:00:00" Value="White" />
										</ColorAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="SelectedInactiveReadOnly">
									<Storyboard>
										<ColorAnimationUsingKeyFrames Storyboard.TargetName="LabelBorder" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" BeginTime="00:00:00" Duration="00:00:00.0010000">
											<EasingColorKeyFrame KeyTime="00:00:00" Value="#FFE9ECFA" />
										</ColorAnimationUsingKeyFrames>
										<ColorAnimationUsingKeyFrames Storyboard.TargetName="LabelText" Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" BeginTime="00:00:00" Duration="00:00:00.0010000">
											<EasingColorKeyFrame KeyTime="00:00:00" Value="Gray" />
										</ColorAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="UnselectedReadOnly">
									<Storyboard>
										<ColorAnimationUsingKeyFrames Storyboard.TargetName="LabelText" Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" BeginTime="00:00:00" Duration="00:00:00.0010000">
											<EasingColorKeyFrame KeyTime="00:00:00" Value="Gray" />
										</ColorAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="SelectedActive">
									<Storyboard>
										<ColorAnimationUsingKeyFrames Storyboard.TargetName="LabelBorder" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" BeginTime="00:00:00" Duration="00:00:00.0010000">
											<EasingColorKeyFrame KeyTime="00:00:00" Value="#FF5EAAFF" />
										</ColorAnimationUsingKeyFrames>
										<ColorAnimationUsingKeyFrames Storyboard.TargetName="LabelText" Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" BeginTime="00:00:00" Duration="00:00:00.0010000">
											<EasingColorKeyFrame KeyTime="00:00:00" Value="White" />
										</ColorAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="SelectedInactive">
									<Storyboard>
										<ColorAnimationUsingKeyFrames Storyboard.TargetName="LabelBorder" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" BeginTime="00:00:00" Duration="00:00:00.0010000">
											<EasingColorKeyFrame KeyTime="00:00:00" Value="#FFE9ECFA" />
										</ColorAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="Unselected" />
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
						<Border x:Name="LabelBorder" Margin="0,0,0,0" Padding="5,0,0,0" Background="White" BorderBrush="#FFE9ECFA" BorderThickness="0,0,1,1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
							<TextBlock x:Name="LabelText" Foreground="Black" HorizontalAlignment="Stretch" Text="{TemplateBinding LabelText}" VerticalAlignment="Center" />
						</Border>
					</ContentPresenter>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<!-- PropertyGridValueControl -->
	<Style TargetType="localControls:PropertyGridValueControl">
		<Setter Property="HorizontalAlignment" Value="Stretch" />
		<Setter Property="HorizontalContentAlignment" Value="Stretch" />
		<Setter Property="VerticalAlignment" Value="Stretch" />
		<Setter Property="VerticalContentAlignment" Value="Stretch" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="localControls:PropertyGridValueControl">
					<Border BorderBrush="#FFE9ECFA" BorderThickness="0,0,1,1">
						<Grid>
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="Auto" />
								<ColumnDefinition Width="*" />
								<ColumnDefinition Width="Auto" />
							</Grid.ColumnDefinitions>
							<ContentControl x:Name="ValueIndicatorControl" Grid.Column="0" Margin="0,0,2,0" HorizontalContentAlignment="Stretch" IsTabStop="False" VerticalAlignment="Center" VerticalContentAlignment="Center" />
							<ContentControl Grid.Column="1" Margin="0,0,0,0" Content="{TemplateBinding Content}" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Center" />
							<ContentControl x:Name="ValueActionControl" Grid.Column="2" HorizontalContentAlignment="Stretch" IsTabStop="False" VerticalAlignment="Center" VerticalContentAlignment="Center" />
						</Grid>
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<!-- PropertyGridHeader -->
	<Style TargetType="localControls:PropertyGridHeader">
		<Setter Property="HorizontalAlignment" Value="Stretch" />
		<Setter Property="HorizontalContentAlignment" Value="Stretch" />
		<Setter Property="VerticalAlignment" Value="Stretch" />
		<Setter Property="VerticalContentAlignment" Value="Stretch" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="localControls:PropertyGridHeader">
					<Grid Background="Transparent">
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="SelectionStates">
								<VisualState x:Name="SelectedActive">
									<Storyboard>
										<DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusElement" Storyboard.TargetProperty="(UIElement.Opacity)" BeginTime="00:00:00" Duration="00:00:00.0010000">
											<EasingDoubleKeyFrame KeyTime="00:00:00" Value="1" />
										</DoubleAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="SelectedInactive">
								</VisualState>
								<VisualState x:Name="Unselected" />
							</VisualStateGroup>
							<VisualStateGroup x:Name="ExpansionStates">
								<VisualState x:Name="Expanded" />
								<VisualState x:Name="Collapsed">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetName="CollapseImage" Storyboard.TargetProperty="(UIElement.Visibility)" BeginTime="00:00:00" Duration="00:00:00.0010000">
											<DiscreteObjectKeyFrame KeyTime="00:00:00">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Collapsed</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpandImage" Storyboard.TargetProperty="(UIElement.Visibility)" BeginTime="00:00:00" Duration="00:00:00.0010000">
											<DiscreteObjectKeyFrame KeyTime="00:00:00">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Visible</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="16" />
							<ColumnDefinition Width="Auto" />
						</Grid.ColumnDefinitions>
						<Grid Grid.Column="0" VerticalAlignment="Center">
							<Image x:Name="CollapseImage" Height="9" Width="9" Source="{TemplateBinding CollapseImageSource}" />
							<Image x:Name="ExpandImage" Height="9" Width="9" Source="{TemplateBinding ExpandImageSource}" Visibility="Collapsed" />
						</Grid>
						<Grid Grid.Column="1" Margin="2" Background="Transparent">
							<TextBlock x:Name="HeaderLabel" Foreground="Gray" HorizontalAlignment="Left" Text="{TemplateBinding HeaderLabelText}" VerticalAlignment="Center" />
							<Rectangle x:Name="FocusElement" Margin="-2,0,-4,0" Fill="Transparent" IsHitTestVisible="False" Opacity="0" Stroke="#FF000000" StrokeDashArray="1 2" StrokeDashCap="Round" StrokeDashOffset="0" StrokeEndLineCap="Round" StrokeLineJoin="Round" StrokeMiterLimit="0" StrokeStartLineCap="Round" StrokeThickness="1.05" />
						</Grid>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<!-- AutoCompleteComboBox -->
	<Style TargetType="localControls:AutoCompleteComboBox">

		<!-- ComboBox should not perform text completion by default -->
		<Setter Property="IsTextCompletionEnabled" Value="False" />

		<!-- The minimum prefix length should be 0 for combo box scenarios -->
		<Setter Property="MinimumPrefixLength" Value="0" />

		<!-- Regular template values -->
		<Setter Property="Margin" Value="0"/>
		<Setter Property="Padding" Value="0"/>
		<Setter Property="Background" Value="#FF1F3B53"/>
		<Setter Property="IsTabStop" Value="False" />
		<Setter Property="HorizontalContentAlignment" Value="Left"/>
		<Setter Property="BorderBrush">
			<Setter.Value>
				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
					<GradientStop Color="#FFA3AEB9" Offset="0"/>
					<GradientStop Color="#FF8399A9" Offset="0.375"/>
					<GradientStop Color="#FF718597" Offset="0.375"/>
					<GradientStop Color="#FF617584" Offset="1"/>
				</LinearGradientBrush>
			</Setter.Value>
		</Setter>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="localControls:AutoCompleteComboBox">
					<Grid Margin="{TemplateBinding Padding}">
						<TextBox IsTabStop="True" x:Name="Text" Style="{TemplateBinding TextBoxStyle}" Padding="0" Margin="0" />
						<ToggleButton x:Name="DropDownButtonControl"
									  HorizontalAlignment="Right"
									  VerticalAlignment="Center"
									  Margin="0"
									  Style="{StaticResource ComboToggleButton}"
									  HorizontalContentAlignment="Center" 
									  Background="{TemplateBinding Background}" 
									  BorderThickness="0" 
									  Height="16" Width="16">
							<ToggleButton.Content>
								<Path x:Name="BtnArrow"
									  Height="4"
									  Width="8"
									  Stretch="Uniform" 
									  Data="F1 M 301.14,-189.041L 311.57,-189.041L 306.355,-182.942L 301.14,-189.041 Z " 
									  Margin="0,0,6,0"
									  HorizontalAlignment="Right">
									<Path.Fill>
										<SolidColorBrush x:Name="BtnArrowColor" Color="#FF333333"/>
									</Path.Fill>
									<Path.RenderTransform>
										<ScaleTransform x:Name="ToggleButtonScale" />
									</Path.RenderTransform>
								</Path>
							</ToggleButton.Content>
						</ToggleButton>
						<Popup x:Name="Popup">
							<Border x:Name="PopupBorder" HorizontalAlignment="Stretch" Opacity="1.0" BorderThickness="0" CornerRadius="3">
								<Border.RenderTransform>
									<TranslateTransform X="2" Y="2" />
								</Border.RenderTransform>
								<Border.Background>
									<SolidColorBrush Color="#11000000" />
								</Border.Background>
								<Border HorizontalAlignment="Stretch" BorderThickness="0" CornerRadius="3">
									<Border.Background>
										<SolidColorBrush Color="#11000000" />
									</Border.Background>
									<Border.RenderTransform>
										<TransformGroup>
											<ScaleTransform />
											<SkewTransform />
											<RotateTransform />
											<TranslateTransform X="-1" Y="-1" />
										</TransformGroup>
									</Border.RenderTransform>
									<Border HorizontalAlignment="Stretch" Opacity="1.0" Padding="2" BorderThickness="2" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="3">
										<Border.RenderTransform>
											<TransformGroup>
												<ScaleTransform />
												<SkewTransform />
												<RotateTransform />
												<TranslateTransform X="-2" Y="-2" />
											</TransformGroup>
										</Border.RenderTransform>
										<Border.Background>
											<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
												<GradientStop Color="#FFDDDDDD" Offset="0"/>
												<GradientStop Color="#AADDDDDD" Offset="1"/>
											</LinearGradientBrush>
										</Border.Background>
										<ListBox x:Name="Selector" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" ItemTemplate="{TemplateBinding ItemTemplate}" />
									</Border>
								</Border>
							</Border>
						</Popup>
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="FocusStates">
								<VisualStateGroup.Transitions>
									<VisualTransition GeneratedDuration="0:0:0.2" To="ToggleButtonOver" />
									<VisualTransition GeneratedDuration="0:0:0.2" To="ToggleButtonOut" />
								</VisualStateGroup.Transitions>
								<VisualState x:Name="ToggleButtonOver">
									<Storyboard>
										<DoubleAnimation Storyboard.TargetName="ToggleButtonScale" Storyboard.TargetProperty="ScaleX" To="1.3" />
										<DoubleAnimation Storyboard.TargetName="ToggleButtonScale" Storyboard.TargetProperty="ScaleY" To="1.3" />
									</Storyboard>
								</VisualState>
								<VisualState x:Name="ToggleButtonOut">
									<Storyboard>
										<DoubleAnimation Storyboard.TargetName="ToggleButtonScale" Storyboard.TargetProperty="ScaleX" To="1" />
										<DoubleAnimation Storyboard.TargetName="ToggleButtonScale" Storyboard.TargetProperty="ScaleY" To="1" />
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
							<VisualStateGroup x:Name="PopupStates">
								<VisualStateGroup.Transitions>
									<VisualTransition GeneratedDuration="0:0:0.4" To="PopupOpened" />
									<VisualTransition GeneratedDuration="0:0:0.2" To="PopupClosed" />
								</VisualStateGroup.Transitions>
								<VisualState x:Name="PopupOpened">
									<Storyboard>
										<DoubleAnimation Storyboard.TargetName="PopupBorder" Storyboard.TargetProperty="Opacity" To="1.0" />
									</Storyboard>
								</VisualState>
								<VisualState x:Name="PopupClosed">
									<Storyboard>
										<DoubleAnimation Storyboard.TargetName="PopupBorder" Storyboard.TargetProperty="Opacity" To="0.0" />
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
							<VisualStateGroup x:Name="ValidationStates">
								<VisualState x:Name="Valid" />
								<VisualState x:Name="InvalidUnfocused">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
											<DiscreteObjectKeyFrame KeyTime="0">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Visible</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="InvalidFocused">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
											<DiscreteObjectKeyFrame KeyTime="0">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Visible</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsOpen">
											<DiscreteObjectKeyFrame KeyTime="0">
												<DiscreteObjectKeyFrame.Value>
													<System:Boolean>True</System:Boolean>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
</ResourceDictionary>